/*westarForm, 此行必须位于第一行, 切不可删除*/
body {
  // font-family: "宋体"，serif;
  margin: 0;
}

.westar_edit {
  padding-left: 4px;
  white-space: pre-wrap;
  caret-color: deepskyblue;

  &:empty:before {
    content: attr(placeholder); /* element attribute*/
    color: grey;
  }

  /*焦点时内容为空*/

  &:focus:before {
    content: none;
  }

  &:focus {
    outline: none;
  }
}

/*滚动条样式*/
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-button,
::-webkit-scrollbar-button:vertical {
  display: none;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-track:vertical {
  background-color: black;
}

::-webkit-scrollbar-track-piece {
  background-color: #f5f5f5;
}

::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:vertical {
  margin-right: 10px;
  background-color: #a6a6a6;
}

::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:vertical:hover {
  background-color: #aaa;
}

::-webkit-scrollbar-corner,
::-webkit-scrollbar-corner:vertical {
  background-color: #535353;
}

#westar_form_style {
  background: #fff;
  overflow: auto;
  height: 100vh;
  margin: auto;

  #westarForm {
    width: 30cm;
    /* border: 2px solid cornflowerblue; */
    margin: auto;
    text-align: center;
    padding: 0.2cm;
    height: 100cm;
    background: white;
    overflow: auto;
  }

  #westarForm input[type=radio] + label {
    margin-right: 15px;
  }

  .westar_form_ceil {
    input[type="checkbox"] {
      width: 20px;
      height: 20px;
      display: inline-block;
      text-align: center;
      vertical-align: middle;
      line-height: 18px;
      margin-right: 10px;
      position: relative;
    }

    input[type="checkbox"]::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      background: #fff;
      width: 100%;
      height: 100%;
      border: 1px solid #d9d9d9;
      border-radius: 4px;
    }

    input[type="checkbox"]:checked::before {
      content: "\2713";
      background-color: #fff;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      border: 1px solid #7D7D7D;
      border-radius:4px;
      color: #7D7D7D;
      font-size: 20px;
      font-weight: bold;
    }
    input[type="radio"] {
      width: 20px;
      height: 20px;
      display: inline-block;
      text-align: center;
      vertical-align: middle;
      line-height: 18px;
      margin-right: 10px;
      position: relative;
    }

    input[type="radio"]::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      background: #fff;
      width: 100%;
      height: 100%;
      border: 1px solid #d9d9d9;
      border-radius: 50%;
    }

    input[type="radio"]:checked::before {
      content: "\2713";
      background-color: #fff;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      border: 1px solid #7D7D7D;
      border-radius: 50%;
      color: #7D7D7D;
      font-size: 20px;
      font-weight: bold;
    }
  }
  #westarForm input[type=checkbox] + label {
    margin-right: 15px;
  }


  //二号字体
  .westar_form_A4_title {
    color: black;
    font-size: 29px;
    text-align: center;
    padding: 10px;
  }

  #westar_form_title {
    box-sizing: border-box;
  }

  .westar_form_title_hei {
    font-family: "黑体";

  }

  .westar_form_title_song {
    font-family: "宋体";
    font-weight: bold;
  }

  .westar_form_body {
    box-shadow: 5px 5px 20px grey;
    margin: auto 5vh 10vh auto;


    &.westar_mode_drag {
      margin-left: 30vw;
      border: 1px solid darkgrey;
    }

    &.westar_mode_read {
      box-shadow: none;
      margin: auto;
    }
  }

  .westar_form_wrap {
    display: grid;
    justify-items: center;

    .westar_page_wrap {
      display: grid;

      .westar_form_ceil {
        border: 1px solid grey;
        text-align: left;
        margin-top: -1px;
        margin-left: -1px;
        padding: 0 5px;
        word-break: break-all;
        display: grid;
        align-items: center;
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        grid-gap: 10px;
        /**
        * div 模拟输入, 撑开 td, 自动换行
        */

        &[contenteditable]:extend(.westar_edit all) {
          padding-top: 8px;
          word-break: break-all;
          word-wrap: break-word;
          background: rgba(178, 254, 142, 0.1);
          box-sizing: border-box;
        }
      }
    }

  }

  .westar_form_page_text {
    text-align: center;
    padding-right: 50vw;
  }

  .westar_form_current {
    border: 2px solid rgb(105, 120, 252) !important;
  }

  .westar_form_hide {
    display: none !important;
  }

  .westar_form_area {
    background: rgba(71, 186, 218, 0.2);
  }

  #westar_form_menu {
    position: fixed;
    z-index: 999;
    display: none;
    overflow: hidden;
    height: 800px;
  }

  .westar_form_menu_body {
    width: 2000px;
    padding: 4px;
  }

  .westar_form_menu_body ul {
    list-style: none;
    width: 200px;
    text-align: center;
    padding: 0;
    margin: 0px;
    background: whitesmoke;
    border: 1px solid green;
    box-shadow: 0 1px 1px #888, 1px 0 1px #ccc;
  }

  .westar_form_menu_body li {
    margin: 0 auto;
    width: auto;
    padding: 5px;
    height: 30px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
  }

  .westar_form_menu_body > ul > li:hover {
    background: #0094FF;
  }

  .westar_form_menu_child {
    position: relative;
    left: 190px;
    top: -28px;
    width: 150px !important;
    display: none;

    li {
      margin: 0 auto;
      width: auto;
      padding: 5px;
      font-size: 17px;
      font-weight: 600;
      cursor: pointer;
    }

    li:hover {
      background: #AFEEEE;

      ul {
        display: block;
      }
    }
  }

  .westar_form_on {
    box-sizing: border-box;
    border: 1px solid #005eff;
  }

  .westar_form_text_left {
    text-align: left !important;
  }

  .westar_form_float_left {
    float: left;
  }

  .westar_form_text_center {
    text-align: center !important;
  }

  .westar_form_text_right {
    text-align: right !important;
  }

  #westar_form_mask {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    z-index: 1;
  }

  #westar_check_mask {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    z-index: 1;
  }

  #westar_form_modal {
    display: block;
    width: 40vw;
    height: 60vh;
    background: white;
    border: 1px solid #808080;
    border-radius: 10px;
    position: fixed;
    top: 10vh;
    left: 30%;
    text-align: center;

    & > input {
      margin-top: 50px;
      width: 400px;
      height: 50px;
      padding: 5px;
      border-radius: 5px;
      border: 1px solid green;
    }

    & > div {
      margin-top: 10px;

      & > input {
        width: 80px;
        height: 32px;
        border-radius: 4px;
        background: none;
        border: 1px solid #0094FF;
      }
    }
  }


  /////////////////////拖拽//////////////////
  .westar_drag_body {
    height: 80vh;
    width: 25vw;
    border: 1px solid darkgrey;
    position: fixed;
    top: 8.4vh;
    left: 2vw;
    display: grid;
    grid-template-rows: 10% 90%;
  }

  // 字段检查框
  .westar_form_check_box {
    width: 400px;
    height: 500px;
    background: white;
    position: relative;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding-top: 28px;
    box-sizing: border-box;
    border-radius: 8px;

    h3 {
      text-align: center;
      color: grey;

      i {
        color: orange;
        margin-right: 10px;
      }
    }

    ul {
      width: 100%;
      margin-left: 0;
      list-style: none;
      //margin-left: -40px;
      li {
        list-style: none;
        background: linear-gradient(to right, #dbb615, #f4aa94);
        color: white;
        padding-left: 5px;
        margin: 5px;
        height: 30px;
        line-height: 30px;
        vertical-align: middle;
        box-sizing: border-box;
      }
    }
  }

  .westar_drag_wrap {
    display: grid;
    grid-template-columns: 10% 30% 50%;
    grid-column-gap: 10px;
    grid-row-gap: 20px;

    div {
      border: 1px solid grey;
      border-radius: 4px;
      margin-top: 10px;
      text-align: center;
      line-height: 40px;
      vertical-align: middle;
    }

    i {
      text-align: center;
      font-size: 1.5vw;
      display: grid;
      align-items: center;
    }

    .westar_drag_k {
    }

    .westar_drag_v {
    }
  }

  .westar_form_field_wrap {
    display: inline-block;
    margin: 1px !important;
    border: none !important;

  }

  .westar_field_date_wrap {
    border: none !important;
    display: grid;
    align-items: center;
    grid-template-columns: repeat(6, 1fr);

    div {
      border: none !important;

      &[contenteditable] {
        background: rgba(178, 254, 142, 0.1);
        border-bottom: 1px solid black !important;
      }
    }
  }


  .westar_field_hand_wrap {
    align-items: end !important;

    div {
      &:extend(.westar_edit all);
      height: 50px;
      width: 100%;
    }
  }

  .westar_form_none_back {
    background: none !important;
  }

  .westar_drag_search {
    &:extend(.westar_edit all);
    border: 1px solid lightskyblue;
    line-height: 50px;
    vertical-align: middle;
    border-radius: 5px;
    margin: 10px;
    padding-left: 10px;
  }

  .westar_drag_list {
    height: 70vh;
    overflow: auto;
    z-index: 9999;
  }
}

